<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        时：<input type="text" v-model="time">
        分钟：<input type="text" v-model="minute">
    </div>
<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const vm = Vue.createApp({
        //该函数返回数据对象
        data() {
            return {
                time:0,
                minute:0
            }
        },
        watch: {
            time(val) {
                this.minute = val * 60;
            },
            // 监听器函数也可以接受两个参数，val是当前值，oldVal是改变之前的值
            minute(val, oldVal) {
                this.time = val / 60;
            }
        }
    }).mount('#app');
</script>


</body>
</html>
